﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TGBTech.Core.Models.ChungTu;

namespace TGBTech.Core.Models.Models.BaoCao.SoChiTietThanhToanKHModel
{
    public class SoChiTietThanhToanKHFactory
    {
        public static SoChiTietThanhToanKHModel createSoChiTietThanhToanKH(Data data, String taikhoanid)
        {
            //init model
            SoChiTietThanhToanKHModel model = new SoChiTietThanhToanKHModel();
            //init default data
            model.SoCT = data.SoCT;
            model.NgayThangCT = data.NgayCT;
            model.DienGiaiCT = data.DienGiaiNo;
            if (data.TaiKhoanCoId == taikhoanid)
            {
                model.IsCo = false;
                model.TKDU = data.TaiKhoanNoId;
                model.NoPhatSinh = data.SoTien;
            }
            else
            {
                model.IsCo = true;
                model.TKDU = data.TaiKhoanCoId;
                model.CoPhatSinh = data.SoTien;
            }

            //return model
            return model;
        }
    }
}
